<template>
    <fieldset>
        <legend><h1>页面三</h1></legend>
        <ul>
            <h3>商品列表</h3>
            <li v-for="(item,i) in allPro">
                <span>{{item.proName}}</span>
                <span>{{item.proPrice}}</span>
            </li>
        </ul>
<!--        点击按钮 更改价格-->
        <button @click="goUPBtn">点击涨价1</button>
        <button @click="goUP(2)">点击涨价2</button>
        <button @click="Random">加分</button>
    </fieldset>
</template>

<script>
    import {mapMutations, mapState} from "vuex";

    export default {
        name: "Pagethree",
        computed:{
        //    原商品
            ...mapState({allPro:"cart"})

        },

        methods:{
            goUPBtn(){
            //    实现点击方法
                 this.$store.commit("goUP",9000)
            },
            ...mapMutations({
             goUP:"goUP"
            }),
            ...mapMutations(["goUP","Random"])
        }
    }
</script>

<style scoped>

</style>